package com.ma.util;

import java.util.concurrent.TimeUnit;

/**
 * @ClassName Sleeper
 * @Author: mayongqiang
 * @DATE 2022/3/4 19:43
 * @Description: 工具类
 */

public class Sleeper {
    private int seconds;

    public static void sleep(int seconds) {
        try {
            TimeUnit.SECONDS.sleep(seconds);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
    public static void sleep(double seconds) {
        try {
            TimeUnit.MILLISECONDS.sleep((int) (seconds * 1000));
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
